//
//  ModelTool.m
//
//  Created by SKY
//  Copyright © 翊sky. All rights reserved.
//

#import "ModelTool.h"

@implementation ModelTool

/**
 *  convert model from dictionary and print it
 */

+ (void)createModelWithDictionary:(NSDictionary *)dict{
    
    printf("\n@interface ModelName :NSObject\n");
    for (NSString *key in dict) {
        
        NSString *type = nil;
        if([dict[key] isKindOfClass:[NSNumber class]]){
            type = @"NSNumber";
        }else
        if ([dict[key] isKindOfClass:[NSString class]]) {
            type = @"NSString";
        }else
        if ([dict[key] isKindOfClass:[NSArray class]]) {
            type = @"NSArray";
        }else{
            type = @"NSDictionary";
        }
        printf("@property (nonatomic,copy) %s *%s;\n",type.UTF8String,key.UTF8String);
    }
    printf("@end\n");
    
}
@end
